home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-01-11 | 54.6 KB | 1,305 lines |
-
-
- The B7Tool Library [B7T]
- Ver. 1.2a
- Library Routines for Microsoft BASIC PDS 7.x
- by R. J. Crouch
- Copyright - 1992-93 - CareWare
- All Rights Reserved
- ____________________________________________________________
-
-
-
- ** What is the B7Tool Library? **
- ======================================
-
-
- B7Tool is a collection of innovative and direct programming
- tools, in the form of a user library, for Microsoft (R),
- BASIC PDS 7.x. It has emerged from a necessity for a
- collection of comprehensive routines to supplement the BASIC
- language. B7T features; a comprehensive selection of mouse
- functions, a unique windowing routine, fast screen save/
- restore routines, fast screen writes, a bar menu routine,
- routines to set and get equipment information, and more.
-
- All of the B7Tool routines are easily incorporated into
- almost any BASIC PDS 7.xx source without greatly increasing
- the efficient size of the "stand-alone" program. The B7Tool
- Library is proposed as a solid foundation from which to
- build your own personal libraries. These library routines
- are intended for use by individuals with some BASIC PDS
- programming experience.
-
-
-
- ** Things to know about the B7Tool Library **
- ===================================================
-
-
- B7Tool is being distributed as a Shareware product. This
- program is not free and is copyrighted to CareWare with all
- rights reserved. If you find B7T of value and continue to
- use its services beyond a 30 day trial period, then you are
- required to register your copy with CareWare. The
- registration fee for B7Tool, on disk with OBJ modules, is
- $25.00 (US). A registration form is provided for your
- convenience. Please see the last page of this document.
-
- B7Tool may be shared with others as long as it remains
- unaltered and distributed in its entirety. A distribution
- fee, not to exceed $8.00, may be imposed by disk vendors to
- cover shipping and handling costs. The following files
- comprise the whole of this product and was originally
- distributed as the self-extracting file B7T12.EXE or the
- ZIPed file B7T12.ZIP.
-
- B7T.LIB B7T.QLB B7T.BI B7TOOL.DOC
- B7T-DEMO.BAS B7T-DEMO.EXE VENDOR.DOC README.TXT
- REGISTER.TXT FILE_ID.DIZ
-
-
-
- ** Things to know about the B7Tool Library **
- ===================================================
-
-
- The B7Tool Library is presented as-is and with no warranties
- expressed or implied. CareWare assumes no responsibility
- for this products use, misuse, or lose of any kind incurred
- by its use.
-
- Upon your completed registration you are granted full
- unrestricted single user operation and support for this
- product. There are no additional licensing fees for modules
- compiled and linked into products you distribute. Any
- comments or suggestions are gratefully accepted and an
- honest attend will be made to answer them.
-
- Microsoft is a registered trademark of the Microsoft Corp.
-
-
-
- ** What the B7Tool Library provides **
- ============================================
-
-
- Mouse Services: Mouse*()
- -------------------------
-
- A majority of the routines in B7T pertain to mouse
- functions. These functions will allow a programmer to
- incorporate the much needed mouse services into any de-
- manding application. They are intelligently written to
- compensate for a few idiosyncrasies that tend to emerge from
- the mouse interrupt (33H).
-
-
- Windowing: DoWindow()
- ----------------------
-
- Windowing for today's applications is not new, but this
- windowing routine adds a few features that will enhance any
- program. The screen write for this routine is serviced by
- machine code for a fast and clean appearance. Select-
- ability for title location, type and location of shadow, and
- a solid frame, make this windowing routine unique from other
- we have seen.
-
-
- Screen save/restore: PutScrn()/GetScrn()
- -----------------------------------------
-
- The ability to save and later restore a screen's contents is
- essential for contemporary programming. These two routines
- are designed to work within the BASIC PDS environment. They
- make use of BASIC PDS's string descriptor block functions
- for ease of use. This pair of routines is written entirely
- of machine code for instant results.
-
-
-
- ** What the B7Tool Library provides **
- ============================================
-
-
- Screen print: PrtScrn()
- ------------------------
-
- This is a little machine code routine that will print to the
- screen, at the location and color desired, any string vari-
- able. It's fast, compact, and simulates in just one CALL
- BASIC PDS's LOCATE, COLOR, and PRINT statements. This
- routine is the heart of the windowing procedure and the
- reason for its speed.
-
-
- Equipment Information: Get*() and Set*()
- -----------------------------------------
-
- These routines will retrieve and set various system equip-
- ment information. These types of services give your
- programs the kind of information it needs for proper
- application and system interaction.
-
-
- Pull-Down Bar Menu: BarMenu()
- ------------------------------
-
- This routine provides a comprehensive and easy means for
- establishing an application menu system. BarMenu is fully
- configurable with five color attributes and is both key and
- mouse driven. (A great value to any Library)
-
-
- Screen string centering: Ctr()
- -------------------------------
-
- This is a handy little function that returns the column
- position needed to center string data or variables on the
- screen. It can easily be incorporated into BASIC PDS's
- LOCATE statement. [i.e. LOCATE 12, Ctr(strg$)]
-
-
- Program delays: Delay()
- ------------------------
-
- This is a smart replacement for BASIC PDS's SLEEP statement
- (which, by the way, takes over 2K of executable code). The
- delay can either be forced or user bypassed with any key or
- mouse button.
-
-
-
- ** What the B7Tool Library provides **
- ============================================
-
-
- Access to system interrupts
- ---------------------------
-
- Incorporated (LINKed) within the B7Tool Library are BASIC's
- QBX.QLB (C), QBX.LIB (C) and QBX.BI (C). These files were
- necessary in the writing of various routines that make use
- BASIC's Interrupt() service. Because of their presence, you
- also have access to DOS service calls. This is a powerful
- feature for any programmer.
-
-
-
- ** What the B7Tool Library does not provide **
- ====================================================
-
-
- B7Tool does not contain routines for data input or manip-
- ulation. It is felt these type of procedures should be
- handled by the programmer for their particular application
- needs. Absent also from this library is the abundance of
- routines that can't possibly be incorporated into every
- program. B7T is intended to be a quality library from which
- to build from.
-
-
-
- ** The nuts and bolts of the B7Tool Library **
- ====================================================
-
-
- The following is a clarified description of the prototypes
- used in the CALL's to these B7Tool library routines. Please
- note the variable types used for the arguments in these
- routines. The mouse service calls are designed to work with
- a Microsoft (R) mouse driver or close compatible. Examin-
- ation of the demo source code can aid in understanding the
- use of these routines.
-
-
- -------------------
- MouseStatus(Ready%)
- -------------------
- This routine does a nondestructive interrupt vector check to
- determine the existence of a mouse driver. This routine
- should be called prior to using any of the other B7T mouse
- routines to insure the presence of the mouse interrupt
- (33H). (if present the mouse is enabled - function 20H)
-
- Passed: An integer variable
-
- Returns: 0 if a mouse driver is not detected
- 1 if a mouse driver has been installed
-
- Example: CALL MouseStatus(have%)
-
-
- ----------------
- MouseReset(Set%)
- ----------------
- This routine will initialize the mouse driver and will allow
- the saving and restoring of two separate mouse states.
-
- Passed: An initialized integer variable or constant
- 0 = hard reset - initializes mouse driver, turns
- mouse pointer off and disables any prior
- user installed events (function 00H)
- 1 = soft reset - reset mouse driver and turns
- pointer off (function 21H)
- 2 = will save the current mouse state to mouse
- buffer #1
- 3 = will restore the mouse state as saved in mouse
- buffer #1
- 4 = will save the current mouse state to mouse
- buffer #2
- 5 = will restore the mouse state as saved in mouse
- buffer #2
-
- Returns: If passed a variable initialized to 0, will reset
- mouse and return number of buttons installed, else
- returns nothing
-
- Example: buttons% = 0
- CALL MouseReset(buttons%)
-
-
-
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- Note: Not all mouse drivers support the saving and
- restoring of the mouse state (MouseReset(2 thru 5)).
- If it is your intention to distribute programs for
- maximum compatibility, you should refrain from using
- these reset features.
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-
- ----------------------
- MouseVersion(Version$)
- ----------------------
- This routine will return both the major and minor version of
- the mouse driver installed.
-
- Passed: A string variable at lease 5 characters in length
-
- Returns: A string containing the version of the mouse
- driver installed. (i.e. 6.123)
-
- Example: CALL MouseVersion(ver$)
-
-
- ---------------------
- MouseVisible(Status%)
- ---------------------
- This routine will allow the mouse pointer to be either
- turned on or off. This routine has been stabilized by an
- internal variable to compensate for the mouse interrupt
- counter. Recursive calls to the same Status% will not
- increase or decrease the mouse interrupt counter. This will
- only be done by opposing Status% calls.
-
- Passed: An initialized integer variable or constant
- 0 = mouse pointer off
- 1 = mouse pointer on
-
- Returns: Nothing
-
- Examples: CALL MouseVisible(1)
- or
- off% = 0
- CALL MouseVisible(off%)
-
-
- ----------------------------------------
- MouseLocate(ScrnRowY%, ScrnColX%, Mode%)
- ----------------------------------------
- This routine will place the mouse pointer at the screen
- location indicated by its arguments. The Mode switch will
- allow the location to be given in either row/column text
- positions or X/Y pixel positions.
-
- Passed: 3 initialized integer variables or constants
- Mode 0 = pixel positions
- ScrnColX% = horizontal (X) position with a value
- from 0 to 632
-
-
-
- ScrnRowY% = vertical (Y) position with a value
- from 0 to 192
-
- note: The pixel given is the upper left dot of
- the standard 8x8 mouse pointer. Pixel
- positions start from 0,0.
-
- Mode 1 = text positions
- ScrnColX% = text column position with a value
- from 1 to 80
- ScrnRowY% = text row position with a value from
- 1 to 25
-
- Returns: Nothing
-
- Examples: CALL MouseLocate(12, 30, 1)
- or
- CALL MouseLocate(y%, x%, 0)
-
-
- ------------------------------------------
- MousePosition(ScrnRowY%, ScrnColX%, Mode%)
- ------------------------------------------
- This routine will return the current position of the mouse
- pointer. The Mode switch will allow the location returned
- to be either given in row/column text positions or X/Y pixel
- positions.
-
- Passed: 2 integer variables and 1 initialized integer
- variable or constant (Mode%)
- Mode 0 = returned values represent X/Y pixel
- positions
- Mode 1 = returned values represent row/column
- positions
-
- Returns: An integer value
- Mode 0
- ScrnColX% = current horizontal (X) position of
- mouse pointer as represented by
- pixels (0 to 632)
- ScrnRowY% = current vertical (Y) position of
- mouse pointer as represented by
- pixels (0 to 192)
-
- note: The pixel returned is the upper left dot
- of the standard 8x8 mouse pointer. Pixel
- positions start from 0,0.
-
- Mode 1
- ScrnColX% = current column position of mouse
- pointer (1 to 80)
- ScrnRowY% = current row position of mouse
- pointer (1 to 25)
-
- Example: CALL MousePosition(TextRow%, TextCol%, 1)
-
-
-
- ------------------------------------------------------------
- MouseLimits(UpRowY%, LeftColX%, LowRowY%, RightColX%, Mode%)
- ------------------------------------------------------------
- This routine will let you limit the motion of the mouse
- pointer. The mouse pointer will reside within the
- boundaries specified by the arguments passed to this
- routine. The Mode switch will allow the limited area to be
- either given in row/column text positions or X/Y pixel
- positions.
-
- Passed: 5 initialized integer variables or constants
- Mode 0 = pixel positions
- LeftColX% = left horizontal (X) position with a
- value from 0 to 632
- UpRowY% = upper vertical (Y) position with a
- value from 0 to 192
- RightColX% = right horizontal (X) position with
- a value from LeftColX% to 632
- LowRowX% = lower vertical (Y) position with a
- value from UpRowY% to 192
-
- note: The pixel given is the upper left dot of
- the standard 8x8 mouse pointer. Pixel
- positions start from 0,0.
-
- Mode 1 = text positions
- LeftColX% = left column position with a value
- from 1 to 80
- UpRowY% = upper row position with a value from
- 1 to 25
- RightColX% = right column position with a value
- from LeftColX% to 80
- LowRowY% = lower row position with a value from
- UpRowY% to 25
-
- Returns: Nothing
-
- Example: CALL MouseLimits(10, 25, 15, 55, 1)
-
-
-
- -------------------------------------------------------------
- MouseExclude(UpRowY%, LeftColX%, LowRowY%, RightColX%, Mode%)
- -------------------------------------------------------------
- This routine will allow the mouse pointer to be excluded
- from any portion of the screen as specified by the arguments
- passed to this routine. When the mouse pointer enters the
- excluded boundaries, the pointer is turned off. The mouse
- interrupt (33H) does not, however, reinstate the mouse
- pointer to the on condition upon exiting the excluded area.
- This process must be performed within the programming code
- itself. The excluded area cannot be saved by the
- MouseReset() routines. The mode switch will allow the ex-
- cluded area to be either given in row/column text positions
- or X/Y pixel positions.
-
- Passed: 5 initialized integer variables or constants
- Mode 0 = pixel positions
- LeftColX% = left horizontal (X) position with a
- value from 0 to 632
- UpRowY% = upper vertical (Y) position with a
- value from 0 to 192
- RightColX% = right horizontal (X) position with
- a value from LeftColX% to 632
- LowRowX% = lower vertical (Y) position with a
- value from UpRowY% to 192
-
- note: The pixel given is the upper left dot of
- the standard 8x8 mouse pointer. Pixel
- positions start from 0,0.
-
- Mode 1 = text positions
- LeftColX% = left column position with a value
- from 1 to 80
- UpRowY% = upper row position with a value from
- 1 to 25
- RightColX% = right column position with a value
- from LeftColX% to 80
- LowRowY% = lower row position with a value from
- UpRowY% to 25
-
- Returns: Nothing
-
- Example: CALL MouseExclude(15, 20, 21, 35, 1)
-
-
-
- -------------------------------------------------
- MouseClick(LeftClick%, MiddleClick%, RightClick%)
- -------------------------------------------------
- This routine will return a value indicating the current
- mouse button in use. The value is only returned upon the
- release of the button, thus returning the value only once.
- This allows the mouse button status to be effectively used
- within a loop.
-
- Passed: 3 integer variables
-
- Returns: 0 = button not in use
- 1 = button has been clicked
-
- Example: CALL MouseClick(lft%, mid%, rgt%)
-
-
- -----------------------------------------------------
- MouseScroll(LeftButton%, MiddleButton%, RightButton%)
- -----------------------------------------------------
- This routine will return a value indicating the current
- mouse button being pressed. This value will remain
- constant until the button is released.
-
- Passed: 3 integer variables
-
- Returns: 0 = button not in use
- 1 = button is being pressed
-
- Example: CALL MouseScroll(lft%, mid%, rgt%)
-
-
- --------------------------------
- MouseCursor(Fore%, Back%, Char%)
- --------------------------------
- This routine allows you to change the character and color of
- the mouse pointer.
-
- Passed: 3 initialized integer variables or constants
- Fore = foreground color for the new pointer
- (within a range of 0 to 15)
- Back = background color for the new pointer
- (within a range of 0 to 7)
- Char = ASCII decimal value for the character of the
- new pointer (within a range of 0 to 255)
-
- Returns: Nothing
-
- Example: CALL MouseCursor(12, 7, 30)
-
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- Note: Not all mouse drivers support the changing of the
- mouse cursor. If it is your intent to distribute
- programs for maximum compatibility, then you should
- consider not using this function.
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-
-
- --------------------------------------------------------
- DoWindow(UpR%, LfC%, VSz%, HSz%, Att%, Frm%, Shw%, Txt$,
- Lct%)
- --------------------------------------------------------
- This routine will create attractive application windows at
- any screen position. You have control over color, type of
- frame and color, type and location of shadow, and location
- of window title and style. This windowing routine offers a
- wide variety of possibilities.
-
- Passed: 8 initialized integer variables or constants
- 1 string variable or constant for title
- UpR = upper row position for start of window
- (within a range of 1 to 24)
- LfC = left column position for start of window
- (within a range of 1 to 79)
- VSz = vertical size of window (# of rows)
- (within a range of 26 minus UpR)
- HSz = horizontal size of window (# of columns)
- (within a range of 81 minus LfC)
- Att = attribute of window colors
- (within a range of 0 to 127)
- ( (background * 16) + foreground )
- Note: Adding 128 to the attribute will
- produce a blinking foreground
- Frm = frame type, if any
- 0 = no frame
- 1 = single line
- 2 = double line
- 3 = single vertical and double horizontal
- 4 = single horizontal and double vertical
- 5 = solid frame enclosing the window
- Shw = shadow location and type, if any
- 0 = no shadow
- 1 = shadow left side and bottom of window
- (black in color)
- 2 = shadow right side and bottom of window
- (black in color)
- 3 = shadow left side and bottom of window
- (tinted black)
- 4 = shadow right side and bottom of window
- (tinted black)
- note: Tinted black is a combination, with
- ASCII character #177, of the color
- attribute outside the window and black.
- 5 = shadow left side and bottom of window
- (shadowed character)
- 6 = shadow right side and bottom of window
- (shadowed character)
- note: The characters within the shadowed
- area are displayed using attribute 8.
- Txt = string variable or constant used for the
- title of the window
- note: Empty double quotes ("") or a string
- initialized to null will not produce
- a title.
-
-
-
- Lct = determines the location of the title, if any
- 0 = title at top without brackets
- 1 = title at bottom without brackets
- 2 = title at top with brackets
- 3 = title at bottom with brackets
- note: If a title is not present, the
- location value has no effect.
-
- note: The horizontal and vertical size cannot be
- less then 2.
-
- Returns: Nothing
-
- Examples: CALL DoWindow(5, 10, 15, 60, 98, 5, 3, "", 0)
- or
- CALL DoWindow(Rw, Cl, Rn, Cn, 4, 0, 0, Text$, 2)
-
-
- -----------------
- PutScrn(ScrnBuf$)
- -----------------
- This routine will allow you to save the entire contents of
- the screen currently being displayed. The screen saved can
- later be retrieved and displayed with the companion routine
- GetScrn(). The screen's contents is saved to a string vari-
- able or array initialized to 4000 characters in length.
- (i.e. DIM ScrnBuf(3) AS STRING * 4000)
-
- Passed: An initialized string variable or array at least
- 4000 characters in length
-
- Returns: current screen's contents
-
- Examples: DIM ScrnBuf AS STRING * 4000
- CALL PutScrn(ScrnBuf)
- or
- DIM SHARED ScrnBufArr(2) AS STRING * 4000
- CALL PutScrn(ScrnBufArr(0)) [default option base]
-
-
- -----------------
- GetScrn(ScrnBuf$)
- -----------------
- This routine will allow you to retrieve and display the
- contents of the screen saved by its companion routine
- PutScrn().
-
- Passed: The string variable or array that contains the
- screen to be displayed.
-
- Returns: Nothing (contents of buffer are displayed)
-
- Examples: CALL GetScrn(ScrnBuf)
- or
- CALL GetScrn(ScrnBufArr(1))
-
-
-
- ---------------------------------
- PrtScrn(Strg$, Row%, Col%, Attr%)
- ---------------------------------
- This is a machine language routine that will print a string
- variable or constant to the screen at the location and color
- indicated by its arguments. The attribute is a combination
- of the foreground and background colors and can be
- determined by the following formula: (background * 16) +
- foreground.
-
- Passed: 3 initialized integer variables or constants
- 1 initialized string variable or constant
- Strg = string variable or constant to be displayed
- Row = screen row for display
- (within a range of 1 to 25)
- Col = screen column for display
- (within a range of 1 to 80)
- Attr = attribute of color to be displayed
- (within a range of 0 to 127)
- Note: Adding 128 to the attribute will
- produce a blinking foreground
-
- Returns: Nothing
-
- Examples: CALL PrtScrn("Hello Universe", 12, 33, 110)
- or
- CALL PrtScrn(hello$, rw%, cl%, att%)
-
-
- ------------------------------
- GetDrive(TotDrives%, CurDrive%
- ------------------------------
- This routine returns the total number of drives installed on
- a system, the current drive location, and the current
- directory location.
-
- Passed: 2 integer variables
-
- Returns: TotDrives% = total number of disk drives installed
- on system
- CurDirve% = numeric value indicating current drive
- (1=A:, 2=B:, 3=C: and so on)
-
- Example: CALL GetDrive(TotDrv%, CurDrv%)
-
-
-
- -------------------
- SetDrive(DriveNum%)
- -------------------
- This routine allows you to change the current drive location
- within an application. Valid drive numbers range from 1 to
- 26. No action is taken if the drive number supplied is not
- valid or the drive does not exist on the system.
-
- Passed: An initialized integer variable or constant
- (1=A:, 2=B:, 3=C: and so on up to 26)
-
- Returns: Nothing
-
- Examples: CALL SetDrive(3)
- or
- NewDrv% = 2
- CALL SetDrive(NewDrv%)
-
-
- --------------------
- DriveSpc(Available&)
- --------------------
- This routine will return the total bytes available on the
- disk drive supplied. The routine is useful when wanting to
- know if enough disk space remains on a drive to write a
- file.
-
- Passed: A long integer containing the drive number to check
- (1=A:, 2=B:, 3=C: and so on)
-
- Returns: The total bytes available on specified drive
-
- Example: Drv& = 2
- CALL DriveSpc(Drv&)
-
-
- -------------------------
- GetSize(FileName$, Size&)
- -------------------------
- This routine returns the file size of the given file
- specification. This routine is useful for determining if a
- file is present.
-
- Passed: 1 initialized string or constant containing the
- file name and its location, if any
- (i.e. C:\B7T\B7T-DEMO.EXE)
- 1 long integer variable
-
- Returns: Size& = size of specified file. If 0 is returned,
- file was not found.
-
- Examples: CALL GetSize("B7T.LIB", FSize&)
- or
- FileSpec$ = "D:\WP\TEST.TXT"
- CALL GetSize(FileSpec$, FSize&)
- IF FSize& <> 0 THEN... etc.
-
-
-
- -------------------
- GetDOS(VersionNum$)
- -------------------
- This routine return a string containing the version of DOS
- currently used by a computer system. The routine is handy
- when wanting to know what system interrupts you can use
- based on the DOS version installed.
-
- Passed: A string variable
-
- Returns: VersionNum$ = current DOS version (i.e. 5.0)
-
- Example: CALL GetDOS(Ver$)
-
-
- ----------------------------------------------------------
- GetVideo(Mode%, Page%, Col%, CurStart%, CurStop%, CurAtt%)
- ----------------------------------------------------------
- This routine can provide you with necessary information on a
- system's current video state. If used at the beginning of a
- program, the information retrieved can be used at its
- closing to restore a system's video status.
-
- Passed: 6 Integer variables
-
- Returns: Mode% = current video mode as outlined by Int 10H,
- Function 00H
- Page% = current video page number
- Col% = number of columns for current video mode
- CurStart% = starting scan line for cursor
- CurStop% = ending scan line for cursor
- CurAtt% = color attribute at cursor position
-
- Example: CALL GetVideo(VMd%, VPg%, Col%, CSt%, CSp%, CAt%)
-
-
- ---------------
- SetVideo(Mode%)
- ---------------
- This routine allows you to set a desired video mode. When
- used in conjunction with the value returned by GetVideo(), a
- system's video mode, if changed within a program, can be
- restored to it initial state.
-
- Passed: An initialized integer variable or constant as
- outlined by Int 10H, Function 00H
-
- Returns: Nothing
-
- Examples: CALL SetVideo(3)
- or
- VMode% = 1
- CALL SetVideo(VMode%)
-
-
-
- ---------------------
- GetComPorts(HowMany%)
- ---------------------
- This routine will return the number of serial ports install
- on a computer.
-
- Passed: An integer variable
-
- Returns: Number of serial ports installed
-
- Example: CALL GetComPorts(NumOfPorts%)
-
-
- -----------------
- Get87(DoWeHave%)
- -----------------
- This routine will return a True or False value representing
- the presence of a math coprocessor.
-
- Passed: An integer variable
-
- Returns: -1 = A math coprocessor has been detected
- 0 = No math coprocessor has been detected
-
- Example: CALL Get87(Have87%)
- IF Have87 THEN... etc.
-
-
-
- -------------------------------------------------------------
- BarMenu(MenuStr(), A1%, A2%, A3%, A4%, A5%, S%, M%, R1%, R2%)
- -------------------------------------------------------------
- This is a comprehensive top line pull-down bar menu routine.
- It's configurable with five color attributes, window frame
- style, and mouse support. This routine allows you to add a
- full and attractive menu to any application. New to this
- routine is an argument allowing you to shadow the menu's
- pull-down windows.
-
- Passed: MenuStr() - a two dimensional string array contain-
- ing the menu items
-
- Note: The (0, 0) element of MenuStr() holds the
- upper limits of each second dimension.
- (i.e. MenuStr(0, 0) = "03050402").
- Each 2d dimension 0 element for each 1st
- dimension holds the level 1 menu item.
-
- A1% - color attribute of level 1 menu bar
- A2% - color attribute for highlighted first letter
- of level 1 menu bar
-
- Note: If these two attributes (A1 & A2) are NOT
- the same value and the first letter of
- all level 1 menu titles are different,
- then BarMenu() will pick the proper menu
- title by pressing the highlighted letter.
-
- A3% - color attribute of level 2 menu window
- A4% - color attribute of level 2 menu window text
- A5% - color attribute of level 2 menu window
- highlighted test (item selected)
- S% - shadow type for menu windows (see DoWindow()
- shadow types for argument values)
- M% - a True (-1) or False (0) value indicating
- if a mouse is to be used
-
- Note: If a mouse is used, the mouse cursor is
- turned off upon entering BarMenu() and
- then turned on upon exiting.
-
- R1% - an integer value indicating the number of
- spaces between each level 1 menu item
- R2% - frame style used for the level 2 menu window
- (see DoWindow() for styles - default 5)
-
- Returns: R1% - level 1 menu item picked
- R2% - level 2 menu item picked
-
- Note: If the <ESC> key or RIGHT mouse button is
- pressed the values returned are 0 and the
- menu exits.
-
-
-
- Example: DIM MenuStr(4, 5) AS STRING
- [ Initialize your array elements ]
- [ MenuStr(0, 0) = "03050402" ]
- [ MenuStr(1, 0) = " File Information " ]
- [ MenuStr(1, 1) = " Get File Size " ]
- [ MenuStr(1, 2) = " View File " ]
- [ Etc... ]
- S% = 6: M% = -1: R1% = 3: R2% = 3
- CALL BarMenu(MenuStr(), 11, 4, 112, 113, 116, S%,
- M%, R1%, R2%)
-
- Note: Please see the Demo source code (B7T-DEMO.BAS) for
- additional information and an example on the use of
- this routine.
-
-
- ------------
- Ctr(String$)
- ------------
- This is a handy little function that returns the column
- position needed to screen center a string variable. It can
- easily be incorporated into BASIC's LOCATE statement.
-
- Passed: An initialized string variable
-
- Returns: Column position needed to screen center a
- string variable.
-
- Examples: LOCATE 12, Ctr(Strg$)
- or
- cntr = Ctr(Strg$)
- LOCATE 12, cntr
-
-
- ----------------------------------
- Delay(Length!, Forced%, UseMouse%)
- ----------------------------------
- This routine is a smart alternative to BASIC PDS's SLEEP
- statement or the numerous appearances of LOOPs. This delay
- can either be forced or user bypass with the keyboard or
- mouse buttons (if installed). The delay makes use of real
- time so CPU speed has little effect.
-
- Passed: 2 initialized integer variable or constant
- 1 initialized long variable or constant
-
- Length = single precision integer indicating the
- length of the delay in seconds
-
-
-
- Forced = integer indicating the type of delay
- 0 = not forced (can be bypassed with
- any key or mouse button)
- -1 = delay is forced (remains in effect
- until specified time has elapsed)
- UseMouse = integer indicating if a mouse can be
- used for a button response
- 0 = do not use a mouse for response
- -1 = a mouse is present and used for a
- response
-
- note: If both Length and Forced are 0, then
- Delay() will wait indefinitely until any
- key or mouse button (if present) is pressed.
-
- Returns: Nothing
-
- Examples: CALL Delay(.25, 1, 0)
- or
- lgth! = 1.25
- Forced% = False
- Mouse% = True
- CALL Delay(lgth1!, Forced%, Mouse%)
-
-
- --------------------------------------
- QBX.QLB (C) - QBX.LIB (C) - QBX.BI (C)
- --------------------------------------
- These three BASIC PDS files are incorporated into B7T's
- libraries. They are necessary for the DOS interrupts used
- by the mouse routines. The following is a list of the
- services provided by these files. Because of their
- presence, you also have access to these important services.
- Please consult your BASIC PDS 7.x reference manuals for
- information on the use of these BASIC PDS CALL's. The
- demonstration source code (B7T-DEMO.BAS) illustrates an
- example of a CALL to the Interrupt() routine.
-
- CALL Absolute()
- CALL Int86Old()
- CALL Int86XOld()
- CALL Interrupt()
- CALL InterruptX()
-
-
-
- ** The $INCLUDE file B7T.BI **
- ====================================
-
-
- The file B7T.BI contains the declarations for the Ctr() and
- Delay() routines. If you intend to use these routines, this
- file must be used in BASIC's metacommand instructions and
- placed at the beginning of your code. Generally, the TYPE
- declarations for the Interrupt() and InperruptX() CALLs are
- also placed in this file. Please see the demonstration
- source code (B7T-DEMO.BAS) for an example of a metacommand
- instruction or consult your BASIC PDS reference manuals for
- information on $INCLUDE: files.
-
-
-
- ** A demonstration of the B7Tool Library **
- =================================================
-
-
- There is an old cliche that states, "A picture is worth a
- thousand words". So, provided with B7Tool is the source
- code [B7T-DEMO.BAS] for a short demonstration of its
- routines. This source code will give you a better
- understanding as to the actual usage of the B7T routines.
- The code is presented in an ASCII format and can be viewed
- with any common text editor or sent to your printer using
- the syntax; COPY B7T-DEMO.BAS PRN. This demonstration is
- quite simple and by no means illustrates the only
- application for the B7Tool Library. If you wish to compile
- this demo, the following command line syntax should be used.
-
- From the DOS command line for a stand-alone EXE:
-
- BC B7T-DEMO/O/Fs;
- LINK B7T-DEMO,,,B7T;
-
- To start BASIC PDS and load B7T-DEMO.BAS:
-
- QBX /L B7T B7T-DEMO
-
- The B7T-DEMO provided with this release was compiled and
- linked within the QBX environment for a stand-alone EXE.
- The following compile and link switches were used by the QBX
- environment.
-
- Compile: /O/Ot/Fs/Lr/FPi/T/C:512
-
- Link: /EX/NOE/NOD:BRT71EFR.LIB
-
- Libraries linked: BCL71EFR.LIB and B7T.LIB
-
-
-
- ** Compiling with the B7Tool Library **
- =============================================
-
-
- When starting BASIC PDS, you will need to supply the name
- of the library to look to for external references. The
- following is an example of this command line using the B7T
- library.
-
- QBX /L B7T [YOURFILE.BAS]
-
- All of the OBJ modules within the B7Tool Library were
- compiled using the command-line compiler (BC) and were
- supplied with the /O (stand-alone EXE) and /Fs (far strings)
- switches. BASIC will not allow modules compiled for near
- strings to be mixed with modules compiled for far strings.
- If you intend to mix the B7T OBJ modules with some of your
- own modules, be sure your OBJ modules were compiled using
- the /Fs switch. Within the QBX environment the near string
- model is never used and are always compiled for far strings
- (/Fs).
-
- B7Tool can be linked to your object modules using the
- standard DOS command line. This process avoids the BASIC
- PDS environment entirely. Your source code (BAS) needs to
- be saved in text (ASCII) format in order for BC to operate
- properly. The following syntax has been tested and works
- quite well.
-
- For stand-alone EXE - BC YOURFILE.BAS/O/Fs;
- LINK YOURFILE.OBJ,,,B7T.LIB;
-
- For run-time EXE - BC YOURFILE.BAS/Fs;
- LINK YOURFILE.OBJ,,,B7T.LIB;
-
- Note: Be sure you supply all necessary command line
- switches needed for your source code when
- compiling (BC). [i.e. BC YOURFILE.BAS/O/E/X/Fs]
-
- Please consult your BASIC reference manuals for more
- detailed information on compiling and linking your programs
- from the DOS command line.
-
-
-
- ** A look inside the B7Tool Library **
- ============================================
-
-
- The B7Tool Library is comprised of eight object code
- modules. With this type of construction, it is possible to
- build libraries containing only the particular routines
- desired, or incorporate them into existing libraries. These
- modules are provided to you (on disk) upon your registration
- of B7Tool. Below is a list of the object modules and the
- routines contained in each.
-
- Module Name Routines Source Type
- ----------- -------- -----------
-
- B7TOOL.OBJ Ctr() BAS
- Delay() BAS
-
- B7WIND.OBJ DoWindow() BAS
-
- B7MOUSE.OBJ Mouse*() BAS
-
- PRTSCRN2.OBJ PrtScrn() ASM
-
- PUTSCRN2.OBJ PutScrn() ASM
-
- GETSCRN2.OBJ GetScrn() ASM
-
- B7MENU.OBJ BarMenu() BAS
-
- B7EQUIP.OBJ GetDirve() BAS
- SetDrive() BAS
- DriveSpc() BAS
- GetVideo() BAS
- SetVideo() BAS
- GetDOS() BAS
- GetSize() BAS
- GetComPorts() BAS
- Get87() BAS
-
- The routine DoWindow() does make CALLs to PRTSCRN2.OBJ and
- must have access to its services. When using the B7WIND
- module, the PRTSCRN2 module should always be linked with it.
-
- If B7MOUSE.OBJ is used separately, it must have access to
- QBX.LIB or QBX.QLB if used within the BASIC PDS environment.
-
- The BarMenu() routine makes CALLs to the following routines
- and must have access to their services.
-
- DoWindow() PrtScrn() GetScrn() PutScrn()
-
- If a mouse in intended for use with BarMenu() then
- B7MOUSE.OBJ also must be accessible.
-
-
-
- ** A look inside the B7Tool Library **
- ============================================
-
-
- The screen handling modules (ASM) employ direct memory
- access and assume the segment address of the regen buffer to
- be the following:
-
- Card Type Segment Address
- ----------- -----------------
-
- Monochrome B000H
-
- Color B800H
-
- The following is a list of internal variables used in the
- mouse routines. These variable names should not be used by
- your program structure in conjunction with the COMMON or
- SHARED Statements.
-
- visible33% mouse1buf33%() mouse2buf33%()
-
- The remaining variables within the B7T routines are
- initialized upon their CALL and are not defined as SHARED.
-
-
-
- ** String Descriptor Block **
- ===================================
-
-
- The following four BASIC PDS routines are also incorporated
- within the B7Tool Library.
-
- StringAssign StringRelease StringAddress StringLength
-
- Because the structure of the far string descriptor block
- for fixed length strings is proprietary and unknown at the
- time of this writing, these BASIC PDS routines are used in
- the ASM modules to decipher the descriptor block for their
- use. You also have access to these services because of
- their inclusion in the B7Tool Library. Please refer the
- your BASIC PDS Reference Manual, "Mixed-Language Programming
- with Far Strings", for more specific information on their
- structure and use.
-
-
-
- ** A few final notes about the B7Tool Library **
- ======================================================
-
-
- This documentation is not written to be a tutorial and makes
- the assumption you have some knowledge of the calling
- conventions for BASIC PDS. The demonstration source code
- (B7T-DEMO.BAS) was written to provide you with a working
- example of the B7T routines and is a valuable source of
- information.
-
- B7Tool was developed and tested on a 8088 machine, running
- at 8 mhz, and a 80386sx machine, running at 16 mhz, and
- should perform as expected on most computers within the "86"
- family.
-
-
-
- ** The Shareware principle works for you **
- =================================================
-
-
- R. J. Crouch
- CareWare
- 10217 Ridge View Dr.
- Grass Valley, CA 95945
- (916) 477-6024 * CIS 74270,516
-
-
- This program is produced by a member of the Association of
- Shareware Professionals (ASP). ASP wants to make sure that
- the shareware principle works for you. If you are unable to
- resolve a shareware-related problem with an ASP member by
- contacting the member directly, ASP may be able to help. The
- ASP Ombudsman can help you resolve a dispute or problem with
- an ASP member, but does not provide technical support for
- members' products. Please write to the ASP Ombudsman at
- 545 Grover Road, Muskegon, MI 49442 or send a CompuServe
- message via easyplex to ASP Ombudsman 70007,3536.
-
-
- _______
- ____|__ | (R)
- --| | |-------------------
- | ____|__ | Association of
- | | |_| Shareware
- |__| o | Professionals
- -----| | |---------------------
- |___|___| MEMBER
-
-
- The B7Tool Library [B7T]
- Ver. 1.2a
- Software Registration Form
- _______________________________________________
-
-
- CareWare
- 10217 Ridge View Dr.
- Grass Valley, CA 95945 Date ____________
-
-
- Quantity Type of registration Cost Total
- -------- -------------------- ---- -----
-
- ______ Registration of your current $20.00 _______
- copy
-
- ______ Registration & latest ver. of $25.00 _______
- B7Tool & OBJ modules on disk
-
- ______ All the above plus all OBJ $50.00 _______
- module source codes on disk
-
- Subtotal _______
-
-
- Disk size: [ ] 5.25 (360) - [ ] 3.5 (720) _______
- (please add $1.00 for ea. 3.5)
-
- Please add $4.00 for disk shipping outside of U.S. _______
- (first class air)
-
- Amount Enclosed _______
-
-
- All registered user will receive prompt and courteous
- support for this product.
-
-
- Name ________________________________________________
-
- Address _____________________________________________
-
- _____________________________________________
-
- City, State, Zip ____________________________________
-
- Phone (optional) ____________________________________
-
- Please help us track the distribution of B7Tool and let us
- know where you found this copy.
-
- ____________________________________________________________
-
- Please make payable to the author - R. J. Crouch
-
- ORDERS OUTSIDE OF U.S. - Please send international
- postal or money orders in U.S. dollars.
-
-
-